<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=function(){
            var oDiv = document.getElementById('div1')
            // alert(oDiv.innerHTML)
            oDiv.innerHTML="<a href='https://baidu.com'>百度</a>"
        }
    </script>
</head>
<body>
    <div id='div1'>
        空内容
    </div>
</body>
</html>